<template>
    <div class="hello">
      <h1>全局状态中的name：{{ $store.state.name }}</h1>
      <button @click="add"></button>
    </div>
  </template>
  
  <script>
  import {ref} from 'vue'
  import{ useStore} from 'vuex'
  export default {
    name: 'Counter',
    props: {
     
    },
    setup(){
        const store=useStore();
        const state=store.state;
        const number=ref(0)
        const add=function(){
            number.value=number.value++;
        }
    }
  }
  </script>
  
 <style scoped></style>